void main(){
    List carts = [
    {"count": 2, "price": 10.0, "selected": true},
    {"count": 1, "price": 30.0, "selected": false},
    {"count": 5, "price": 20.0, "selected": true}
  ];

  // 计算选中的商品总金额 forEach 或者 for
  double total = 0;
  carts.forEach((item){
    if(item['selected']){
      total += item['count'] * item['price'];
    }
  });
  print(total);
}